package ywh.event
{
	import ywh.player.AbstractShower;
	import flash.events.Event;
	
	/**
	 * 播放器事件;
	 * @author WilliWHYang
	 */
	public class PlayerEvent extends Event
	{
		/**
		 * 播放器初始化成功;
		 */
		public static const PLAYER_INIT:String = "PLAYER_INIT";
		/**
		 * 播放器状态改变;
		 */
		public static const PLAYER_CHANGE_STATE:String = "PLAYER_CHANGE_STATE";
		
		private var _targetPlayer:AbstractShower;
		private var _data:Object;
		
		public function PlayerEvent(type:String, targetPlayer:AbstractShower, data:Object = null)
		{
			super(type, false, false);
			_targetPlayer = targetPlayer;
			_data = data;
		}
		
		public override function clone():Event
		{
			return new PlayerEvent(type, _targetPlayer, _data);
		}
		
		public override function toString():String
		{
			return formatToString("PlayerEvent", "type", "targetPlayer", "data", "bubbles", "cancelable", "eventPhase");
		}
		
		public function get targetPlayer():AbstractShower
		{
			return _targetPlayer;
		}
		
		public function get data():Object
		{
			return _data;
		}
	
	}

}